< previous page page_91 next page >

Page 91
Common Events
Many events are common from one control or form to another. Lets talk about these common events and what they do before we discuss what each control does specifically (see Table 5.2). It is important to remember that each control has these common events, but each one will have its own particular events as well. For example, you may have five text boxes on a form, and each text box will have these events. Therefore, you can write code to respond differently to the Click() event on each text box.
Table 5.2 Common Event Names.
Event NameDescription
ClickThis event occurs when you click a particular control or form.
DblClickThis event occurs when you double-click a control or form.
ChangeThis event occurs with a text box and certain other controls whenever the data in the control changes in response to user input or your source code.
GotFocusThis event occurs as you move from one control to another. Each control receives this event as you tab from one control to the other. This event happens as you tab into a control.
LostFocusThis event occurs as you move from one control to another. Each control receives this event as you tab from one control to the other. This event will fire when you tab out of a control.
KeyPressThis event occurs whenever you press a key on a control or form.
KeyDownThis event occurs when a key is pressed down on a control or form.
KeyUpThis event occurs when a key is released after being pressed down on a control or form.
MouseDownThis event occurs when any of the mouse buttons are pressed down on a control or form.
MouseUpThis event occurs when the mouse button is released after being pressed down on a control or form.
MouseMoveThis event occurs when the mouse is moved over a control or form.

The preceding events are just a small sample of the many events that happen for each control. Many controls have very specific events that relate only to how that control works. Youll learn about these generic and specific events in this chapter and in future chapters.

 
< previous page page_91 next page >

If you like this book, buy it!